<?php
class RemindModel extends Orm_Base{
    public $table = 'remind';
    public $field = array(
        'id' => array('type' => "int(11) unsigned",'comment' => ''),
        'sid' => array('type' => "int(11) unsigned",'comment' => '关联老年人ID'),
        'remind_type' => array('type' => "tinyint(1)",'comment' => '提醒类型(1.铃声、2.震动)'),
        'event_type' => array('type' => "tinyint(2)",'comment' => '提醒事件类型'),
        'sw_id' => array('type' => "int(11)",'comment' => '关联护工ID'),
        'status' => array('type' => "tinyint(1)",'comment' => '响应类型'),
        'startdate' => array('type' => "int(10)",'comment' => '起始日期'),
        'enddate' => array('type' => "int(10)",'comment' => '结束日期'),
        'starttime' => array('type' => "int(11)",'comment' => ''),
        'endtime' => array('type' => "int(11)",'comment' => ''),
        'respond_time' => array('type' => "time",'comment' => '响应时间点'),
        'description' => array('type' => "varchar(255)",'comment' => '事件描述'),
        'remarks' => array('type' => "varchar(255)",'comment' => '备注'),
        'created' => array('type' => "int(11)",'comment' => ''),
        'updated' => array('type' => "int(11)",'comment' => ''),
    );
    public $pk = 'id';
    //身体状况
    public $tBodystatus = array(
        '0' => '自理',
        '1' => '半自理',
        '2' => '不能自理',
        '3' => '完全不能自理'
    );
    //获取性别
    private function getSex($num){
        $tSIMO = new SexinfoModel;
        $tData = $tSIMO->field('introduce')->where('num = '.$num)->fRow();
        return $tData['introduce'];
    }
    //获取民族
    private function getNation($num){
        $tNIMO = new NationinfoModel;
        $tData = $tNIMO->field('introduce')->where('num = '.$num)->fRow();
        return $tData['introduce'];
    }
    //获取宗教
    private function getReligion($num){
        $tRIMO = new ReligionModel;
        $tData = $tRIMO->field('introduce')->where('num = '.$num)->fRow();
        return $tData['introduce'];
    }
}
?>
